package ar.fiuba.tp7552.buildadmin.tags;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts2.components.Component;
import org.apache.struts2.views.jsp.ComponentTagSupport;

import com.opensymphony.xwork2.util.ValueStack;

public class PaginateFilterTableTag extends ComponentTagSupport {
	
	private String tableId;
	private boolean filter = true;
	
	@Override
	public Component getBean(ValueStack arg0, HttpServletRequest arg1, HttpServletResponse arg2) {
		return new PaginateTableFilter(arg0);
	}
	
	protected void populateParams() {
        super.populateParams();
        PaginateTableFilter ptf = (PaginateTableFilter) component;
        ptf.setTableId(tableId);
        ptf.setFilter(filter);
    }

	public String getTableId() {
		return tableId;
	}

	public void setTableId(String tableId) {
		this.tableId = tableId;
	}

	public boolean isFilter() {
		return filter;
	}

	public void setFilter(boolean filter) {
		this.filter = filter;
	}
}
